{% load static %}
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport"
          content="width=device-width, initial-scale=1, user-scalable=no, shrink-to-fit=no, viewport-fit=cover">

    <link href="{% static "weui.min.css" %}" rel="stylesheet">
    <link href="{% static 'bootstrap.min.css' %}" rel="stylesheet">
    <link href="{% static 'style.css' %}" rel="stylesheet">
    <link href="{% static 'line-awesome-nob.min.css' %}" rel="stylesheet">
    <script src="{% static 'hm.js.下载' %}"></script>
    <script src="{% static 'hm(1).js.下载' %}"></script>

    <script src="./用户中心(改)_files/jquery-1.12.4.min.js.下载"></script>
    <script src="./用户中心(改)_files/weui.min.js.下载"></script>
    <script src="./用户中心(改)_files/app.js.下载"></script>
    <link rel="icon" href="data:;base64,iVBORw0KGgo=">
    <title>用户中心</title>
</head>
<body class="color-theme-blue push-content-right theme-light ">
<div class="wrapper">
    <div class="sidebar sidebar-left" id="leftmenuarea">
        <div class="profile-link"><a
                href="file:///C:/Users/%E8%B5%B5%E4%BC%A0%E6%AF%85/Desktop/%E7%94%A8%E6%88%B7%E4%B8%AD%E5%BF%83acc.html#"
                class="media">
            <div class="w-auto h-100">
                <figure class="avatar avatar-40"><i class="la la-user" style="font-size:40px"></i></figure>
            </div>
            <div class="media-body"><h5 class=" mb-0">赵传毅 <span class="status-online bg-success"></span></h5>
                <p>student</p></div>
        </a></div>
        <nav class="navbar">
            <ul class="navbar-nav">
                <li class="nav-item"><a href="file:///C:/student/courses"> 首页</a></li>
                <li class="nav-item"><a href="file:///C:/student/account?from=menu"> 账户设置/解绑</a></li>
                <li class="nav-item"><a href="file:///C:/clearcache.php?ref=/student"> 清空登录缓存</a></li>
                <li class="nav-item"><a href="file:///C:/student/password"> 修改密码</a></li>
            </ul>
        </nav>
    </div>
    <div class="page vue-loading" style="position: absolute;overflow-y: auto">
        <style>
            #processtask_info b {
                min-width: 5rem;
                display: inline-block;
                text-align: right;
            }

            #processtask_info .card-body > div {
                margin-bottom: 8px;
            }

            .breadcrumb-item + .breadcrumb-item::before {
                content: ">";
            }

            .breadcrumb-item span {
                font-size: 12px;
                border-radius: 3px;
                padding: 1px 5px;
            }

            .breadcrumb-item span.status-1 {
                background: #5FB878;
                color: #fff;
            }

            .breadcrumb-item span.status0 {
                background: #1E9FFF;
                color: #fff;
            }

            .breadcrumb-item span.status10 {
                background: #5FB878;
                color: #fff;
            }

            .breadcrumb-item span.status20 {
                background: #FFB800;
                color: #000;
            }

            .breadcrumb-item span.status28 {
                background: #f5222d;
                color: #fff;
            }

            .breadcrumb-item span.status29 {
                background: #f5222d;
                color: #fff;
            }


            .breadcrumb-item span.status30 {
                background: #FF5722;
                color: #fff;
            }

        </style>
        <header class="row m-0 fixed-header">
            <div class="left"><a href="javascript:void(0);" onclick="history.go(-1);">
                <img src="{% static 'aaaa.png' %}" alt="Back" style="width: 30px; height: auto;">
            </a>
            </div>
            <div class="col center">
                <a href="javascript:void(0);" class="logo">审批</a>
            </div>
            <div class="right" style="width:120px;font-size:1rem;">
                <a href="https://wxf9a9a1438f1fbdd5.g8n.cn/student/processtasks/todo" class="w-100"
                   style="line-height: 40px;">查看全部待审批</a>
            </div>
        </header>
        <div class="page-content" style="padding: 50px 5px;">
            <div class="card mb-3 mt-2" id="processtask_info">
                <div class="card-header">
                    <span style="float: right" class="text-success">已完成</span>
                    详情
                </div>
                <div class="card-body">
                    <div style="color: #000"><b>发起人：</b><strong> {{ student_name }}</strong><span
                            style="color:#aaa;font-size: 12px;"> ({{ student_id }},大数据与基础科学学院（马克思主义学院）-{{ level }}-{{ teacher_name }},{{ major }} -{{ level }}{{ level_2 }})请假（{{ start_time|date:"m月d日" }}的{{ leave_request_type }}）</span>
                    </div>
                    <div class="mt-10">
                        <ul class="list-group form-data-list mb-3">
                            <li class="list-group-item list-group-header">
                                <span class="label">标准请假表单</span>
                            </li>


                            <li class="list-group-item">
                                <span class="label mr-10">请假类型</span>
                                <span class="badge ">{{ leave_request_type }}</span>
                            </li>


                            <li class="list-group-item">
                                <span class="label mr-10">是否离校</span>
                                <span class="badge ">{{ if_or_school }}</span>
                            </li>


                            <li class="list-group-item">
                                <span class="label mr-10">是否离开本市</span>
                                <span class="badge ">{{ if_or_city }}</span>
                            </li>


                            <li class="list-group-item">
                                <span class="label mr-10">具体去向</span>
                                <span class="badge ">{{ txt_2 }}</span>
                            </li>


                            <li class="list-group-item">
                                <span class="label mr-10">起始时间</span>
                                <span class="badge ">{{ start_time|date:"Y-m-d H:i" }} </span>
                            </li>


                            <li class="list-group-item">
                                <span class="label mr-10">结束时间</span>
                                <span class="badge ">{{ end_time|date:"Y-m-d H:i" }}</span>
                            </li>


                            <li class="list-group-item">
                                <span class="label mr-10">联系电话</span>
                                <span class="badge ">
                                    <span><a href="tel:15624357929" class="link">{{ phone_num }}</a></span>
                
                            </span>
                            </li>


                            <li class="list-group-item">
                                <span class="label mr-10">事由说明</span>
                                <span class="badge ">{{ txt_ }}</span>
                            </li>
                        </ul>
                    </div>
                    <div>审批方案：管理团队中老师身份审核</div>
                    <div>
                        <ol class="breadcrumb" style="overflow-x: auto">
                            <li dt="2024-09-14 10:31:41" comment="" user-type="0" class="breadcrumb-item"><span
                                    class="status-1">{{ student_name }} 发起</span>
                            </li>
                            <li dt="2024-09-14 11:16:50" comment="" user-type="1" class="breadcrumb-item"><span
                                    class="status10">{{ teacher_name }} 通过</span>
                            </li>
                        </ol>
                    </div>
                </div>
            </div>
            <div class="card mb-3" id="processtask_timeline">
                <div class="card-header">审批历史</div>
                <div class="card-body p-1">
                    <div class="list-group list-group-flush">
                        <div class="list-group-item list-group-item-action">
                            <div class="d-flex w-100 justify-content-between">
                                <div class="mb-1"><b>{{ student_name }}</b></div>
                                <small class="text-muted"><span class="status-1">发起</span></small>
                            </div>
                            <p class="mb-1">{{ time_1|date:"Y-m-d H:i" }}</p>
                            <small class="text-muted"></small>
                        </div>
                        <div class="list-group-item list-group-item-action">
                            <div class="d-flex w-100 justify-content-between">
                                <div class="mb-1"><b>{{ teacher_name }}</b></div>
                                <small class="text-muted"><span class="status10">通过</span></small>
                            </div>
                            <p class="mb-1">{{ time_2|date:"Y-m-d H:i" }}</p>
                            <small class="text-muted"></small>
                        </div>
                    </div>
                </div>
            </div>

            <div class="px-4 mt-4 flex">
                <a class="text-muted mr-4" href="https://wxf9a9a1438f1fbdd5.g8n.cn/student/course/106216/leaves">
                    <i class="la la-list"></i>
                    业务列表
                </a>

                <a class="text-muted" href="https://wxf9a9a1438f1fbdd5.g8n.cn/student/course/106216/leaves/7360544">
                    <i class="la la-file-alt"></i>
                    业务详情
                </a>
            </div>

            <div style="height:100px;"></div>
            <div>

            </div>
        </div>
        <script>
            $(function () {
                //其实没太大用，因为目前都是隐藏状态
                area_ini();//初步的一些窗口的显示还是隐藏的初始化

                //需要下一步但是下一步没有审核人，需要处理一下，这是临时代码，有空再优化
            });
            //标记点击时是否直接提交
            var action_selpeople_auto_status = null;

            function action_selpeople(_uid) {
                $("[name='to_user_ida[]'][value=" + _uid + "]").prop('checked', true);
                if (action_selpeople_auto_status !== null) {
                    $('[name=audit_status][value=' + action_selpeople_auto_status + ']').prop('checked', true);
                }
                // form_submit(); // 先不直接提交吧，这里只选人
            }


            function action_submit(_status) {
                $('[name=audit_status][value=' + _status + ']').prop('checked', true);
                var wasVisible = $('#next_area').is(':visible');

                //审批状态变更时相关的一些操作
                audit_statu_change();

                //新审批页面对不同状态的相应
                if (_status == 10) {
                    //检测下一步的审核人员，人数超过1，需要选择下一步的人员，点确定提交
                    var itemscount = $("[name='to_user_ida[]']").length;
                    if (itemscount > 1) {
                        action_selpeople_auto_status = _status;
                        if (wasVisible && $("[name='to_user_ida[]']:checked").length > 0) {
                            //下一步选择框已经显示出来了，知道可以选不同的人了，并且还选过了
                            //不拦截，直接提交
                        } else {//没有显示出来，弹出来让你知道可以选（接下来可以点人也可以接种再点一次同意）
                            $('#next_area').show('fast');
                            return;
                        }

                    } else if (itemscount == 1) {//要确保唯一的一个是选中状态
                        $($("[name='to_user_ida[]']")[0]).prop('checked', true);
                    } else//下一步没有可选的审核人员，还要看是不是最终步骤，此处不再判断
                    {

                    }
                    //或直接提交
                } else {
                    //其他，
                    // 检测理由，进行提示，
                    // 直接提交
                }
                form_submit();
            }

            function form_submit() {
                $('#mainform').submit();
            }

            function audit_statu_change() {//状态变更的一些关联操作
                if ($('[name=audit_status]:checked').length > 0) {
                    var _ase = $('[name=audit_status]:checked');
                    var _finish = _ase.attr('finish');//not|can|must
                    if (typeof (_finish) == 'undefined' || _finish == '')
                        _finish = 'not';
                    var btns = $('#btns');

                    if (_finish == 'not')//不能提前结束
                    {
                        $('#finish_area').hide();
                        $('#finish_chkbox').prop('checked', false);
                        $('#next_area').show();

                        if (btns.hasClass('stop-me')) {
                            btns.hide();
                        }
                    } else {
                        if (_finish == 'must')//只要处理，必须提前结束
                        {
                            $('#finish_area').hide();
                            $('#finish_chkbox').prop('checked', true);
                            $('#next_area').hide();
                            btns.show();
                        }
                        if (_finish == 'can')//可以自由选择是否结束
                        {
                            $('#finish_area').show();
                            $('#finish_chkbox').prop('checked', false);
                            $('#next_area').show();
                            btns.show();
                        }
                    }
                }
            }

            //其实没太大用，因为目前都是隐藏状态
            function area_ini() {
                //看一下选项清空，进行一下预处理。
                var _f_num = {not: 0, must: 0, can: 0};
                $('[name=audit_status]').each(function () {
                    var _finish = $(this).attr('finish');//not|can|must
                    if (typeof (_finish) == 'undefined' || _finish == '')
                        _finish = 'not';
                    _f_num[_finish] = 1;
                });
                if (_f_num['must'] > 0 && _f_num['not'] == 0 && _f_num['can'] == 0) {
                    //全是必须结束，初始化直接显示 直接结束按钮。
                    //永不显示下一步的人员选择
                    $('#finish_area').hide();
                    $('#finish_chkbox').prop('checked', true);
                    $('#next_area').hide();
                }
                if (_f_num['not'] > 0 && _f_num['must'] == 0 && _f_num['can'] == 0) {
                    //永不显示直接结束按钮
                    $('#finish_area').hide();
                    $('#finish_chkbox').prop('checked', false);
                    $('#next_area').show();
                }
            }

            function validateForm(form) {
                var $as = $(form).find('[name=audit_status]');
                if ($as.length && !$as.filter(':checked').length) {
                    alert('请选择需要的操作！');
                    return false;
                }

                if ($as.length && !$as.filter('[value=10]:checked').length && !$(form).find('[name=audit_comment]').val()) {
                    if ($('#comment_area').is(':visible')) {
                        alert('该操作必须备注原因等信息后再提交');
                    } else {
                        $('#audit_comment').css('border-bottom', '2px solid red');
                    }

                    $('#comment_area').show('fast');
                    $('#audit_comment').focus();
                    return false;
                }

                var $ts = $(form).find('[name="to_user_ida[]"]');
                if ($ts.length && !$ts.filter(':checked').length) {
                    alert('请选择下一步交给谁来审批！');
                    return false;
                }
                return true;
            }


        </script>
    </div>
</div>

<script src="file:///C:/Users/%E8%B5%B5%E4%BC%A0%E6%AF%85/Desktop/%E7%94%A8%E6%88%B7%E4%B8%AD%E5%BF%83acc_files/bootstrap.bundle.min.js.%E4%B8%8B%E8%BD%BD"></script>
<script src="html_files/main.js.下载"></script>
<script>

</script>
<script>
    var _hmt = _hmt || [];
    (function () {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?362de400d3fe4117e8e3513a52c0da9d";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
    })();
</script>

</body>
</html>